package cn.tedu.di;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Student {
    public String sname = "皮皮虾";

    @Autowired//完成对象间的依赖关系spring di
    //相当于底层帮你维护里两个对象间的关系：new Student().setTeacher(new Teacher())
    public Teacher teacher;

    @Override
    public String toString() {
        return "Student{" +
                "sname='" + sname + '\'' +
                ", teacher=" + teacher +
                '}';
    }


}
